from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeCone
from OCC.Core.TopLoc import TopLoc_Location
from OCC.Core.TopoDS import TopoDS_Shape
from OCC.Core.gp import gp_Trsf, gp_Pnt, gp_Ax1, gp_Dir
from OCC.Display.OCCViewer import rgb_color
from OCC.Display.SimpleGui import init_display

my_cone = BRepPrimAPI_MakeCone(1, 0, 4).Shape()
cone = TopoDS_Shape(my_cone)
T1 = gp_Trsf()
ax = gp_Ax1(gp_Pnt(0, 1, 0), gp_Dir(0, 6, 4))
T1.SetRotation(ax, 1)
coneLoc = TopLoc_Location(T1)
my_cone.Move(coneLoc)

if __name__ == "__main__":
    display, start_display, add_menu, add_function_to_menu = init_display()
    display.DisplayShape(cone, update=True, color=rgb_color(0, 0, 0))
    display.DisplayShape(my_cone, update=True, color=rgb_color(1, 0, 0))
    start_display()
